Skip to content

Update shadcn theme and fix/standardize styling#2193

Merged
myieye merged 16 commits into
developfrom
update-shadcn-theme
Mar 10, 2026
Merged

Update shadcn theme and fix/standardize styling#2193
myieye merged 16 commits into
developfrom
update-shadcn-theme

Conversation

@myieye

@myieye myieye commented Mar 5, 2026

Copy link
Copy Markdown
Collaborator
  • Updates to the latest shadcn theme colours
  • Fixes various components that were not aligned with the new shadcn design
  • Redesigned the ListItem states, so that the focus-visible style finally matches everything else in the app
  • Updated the writing-system colours, because we were already told a long time ago that the contrast should be better
  • Redesigned the theme-picker button, so it has better contrast on the home-view in dark and doesn't look so weird in light
  • Added a storybook story for viewing all the writing-system colours. Also added an entry at the beginning of the demo entries that demos all writing system colours

Various screenshots:
image
image
image
image

EDIT: the theme colours above are partially out of date. I improved the contrast of some of the primary colours and added a story to demo them:
image

myieye added 11 commits March 5, 2026 10:25
The contrast of the current values is unacceptable and the themes demo page is using these new values
Now it uses "focus-visible:ring-[3px] focus-visible:ring-ring/50" like everything else
This was only affecting ListItem, which isn't using an outline anymore. So, the issue doesn't currently affect us, but it was VERY confusing.
@github-actions github-actions Bot added the 💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related label Mar 5, 2026
@coderabbitai

coderabbitai Bot commented Mar 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 8867ff9d-1b13-483b-8aef-ad65f94bbf80

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR switches color models from HSL to OKLCH in styling, restructures the theme configuration from a single theme to multiple data-theme-driven variants, simplifies the ThemePicker component API by replacing buttonProps with a variant prop, refactors ListItem and button styling with new border-based selection indicators and focus handling, removes focus ring injection from input components, and updates writing system color constants to darker accent families.

Changes

Cohort / File(s) Summary
Color Model Migration
frontend/viewer/src/app.css, frontend/viewer/src/home/AppBar.svelte
Replaced HSL color syntax with OKLCH-based color stops and gradients. Updated shimmer animation and linear-gradient declarations to use OKLCH color space with CSS variables.
Theme Architecture Refactor
frontend/viewer/src/theme.css, frontend/viewer/tailwind.config.ts
Restructured theme from single :root/.light/.dark model to multiple data-theme attributes (green, rose, orange, violet, stone). Moved color definitions into @theme inline block with full OKLCH token mappings. Removed custom theme extensions from Tailwind config.
ThemePicker API Simplification
frontend/viewer/src/lib/components/ThemePicker.svelte, frontend/viewer/src/home/HomeView.svelte, frontend/viewer/src/project/ProjectSidebar.svelte
Replaced buttonProps with variant prop in ThemePicker. Updated HomeView to use default ThemePicker (no props) and ProjectSidebar to use variant="ghost".
ListItem and Button Styling
frontend/viewer/src/lib/components/ListItem.svelte, frontend/viewer/src/lib/components/ui/button/button.svelte, frontend/viewer/src/home/ProjectListItem.svelte, frontend/viewer/src/project/browse/sort/SortMenu.svelte
Refactored ListItem with left border selection indicator (border-l-5, aria-selected:border-l-primary) and updated hover/focus styles. Moved border classes from button base to outline variant. Adjusted SortMenu trigger styling with buttonVariants composition. Simplified ProjectListItem skeleton styling.
Input Component Refactoring
frontend/viewer/src/lib/components/ui/input/composable-input.svelte, frontend/viewer/src/lib/components/ui/input/input-shell.svelte, frontend/viewer/src/lib/components/ui/input/input.svelte
Removed focusRingClass prop from InputShell and composable-input. Enhanced input.svelte shell variant with has-[.real-input:focus-visible] selectors and real-input wrapper class guidance. Added selection color styling to ghost variant.
Writing System Services
frontend/viewer/src/project/data/writing-system-service.svelte.ts, frontend/viewer/src/stories/editor/fields/ws-colors.stories.svelte
Updated color constants to darker accent families (emerald-700, fuchsia-700, amber-700, blue-700, rose-700, lime-700). Added new Storybook story showcasing writing system color themes in light and dark modes.
Minor Layout Updates
frontend/viewer/src/project/browse/EntryView.svelte
Added md:pb-2 padding utility to EntryEditor container on medium screens.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • #1852 — Modifies the same UI components (ThemePicker.svelte, ListItem.svelte, AppBar.svelte) with overlapping button/variant and component API changes.
  • #1547 — Updates ThemePicker and ProjectSidebar usage and API integration.
  • #2088 — Modifies the same writing-system-service.svelte.ts file.

Suggested reviewers

  • hahn-kev
  • rmunn

Poem

🐰 OKLCH colors dance so bright,
Themes now shimmer in the light!
Border lines mark what's selected,
Focus rings are now perfected—
A colorful refactor's delight! 🎨✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: updating the shadcn theme and fixing/standardizing styling across the codebase, which matches the changeset's primary focus.
Description check ✅ Passed The description is directly related to the changeset, providing detailed context about theme updates, component redesigns, color adjustments, and new storybook additions with supporting screenshots.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch update-shadcn-theme

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

UI unit Tests

  1 files  ±0   54 suites  +4   25s ⏱️ -1s
140 tests +2  140 ✅ +2  0 💤 ±0  0 ❌ ±0 
207 runs  +4  207 ✅ +4  0 💤 ±0  0 ❌ ±0 

Results for commit 3ccb93c. ± Comparison against base commit f896e70.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

C# Unit Tests

162 tests  ±0   162 ✅ ±0   18s ⏱️ -1s
 23 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 3ccb93c. ± Comparison against base commit f896e70.

♻️ This comment has been updated with latest results.

@argos-ci

argos-ci Bot commented Mar 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ⚠️ Changes detected (Review) 8 changed Mar 9, 2026, 1:31 PM

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
frontend/viewer/src/project/browse/sort/SortMenu.svelte (1)

51-51: Avoid composing both badge and button variant systems on one trigger.

buttonVariants(...xs...) and badgeVariants(...) carry overlapping sizing/spacing/text utilities, so the final style depends on class-order collisions. Consider using one source of truth (prefer buttonVariants) and add explicit badge-like overrides only as needed.

♻️ Suggested cleanup
-  <ResponsiveMenu.Trigger class={cn(buttonVariants({variant: 'secondary', size: 'xs'}), badgeVariants({ variant: 'secondary' }), 'border-none h-7')}>
+  <ResponsiveMenu.Trigger
+    class={cn(
+      buttonVariants({ variant: 'secondary', size: 'xs' }),
+      'h-7 rounded-full px-2 text-xs border-none'
+    )}
+  >
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/viewer/src/project/browse/sort/SortMenu.svelte` at line 51, The
trigger currently composes both buttonVariants and badgeVariants
(ResponsiveMenu.Trigger with cn(buttonVariants(...), badgeVariants(...))),
causing conflicting sizing/spacing; remove badgeVariants usage and rely on
buttonVariants({ variant: 'secondary', size: 'xs' }) as the single source of
truth, then add any explicit badge-like overrides (e.g., small padding,
rounded-full, text-xs) directly in the class string or via a small helper so
ResponsiveMenu.Trigger styling is deterministic and does not depend on class
order.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@frontend/viewer/src/lib/components/ListItem.svelte`:
- Line 42: Replace the invalid Tailwind utility "border-l-5" used in the class
string (the segment containing "border-l-5 border-l-transparent
aria-selected:border-l-primary" in ListItem.svelte) with a valid utility; either
use the arbitrary value "border-l-[5px]" if a 5px left border is required or
"border-l-4" if the design intends the nearest standard width, and keep the rest
of the classes ("border-l-transparent" and "aria-selected:border-l-primary")
unchanged.

In `@frontend/viewer/src/stories/editor/fields/ws-colors.stories.svelte`:
- Around line 21-23: Remove the stray debug text "asd" that was accidentally
left inside the story template rendering; locate the snippet where template() is
used (the block containing "{`#snippet` template()}" and the surrounding <div
class="flex flex-col gap-8 p-4">) and delete the standalone "asd" so only the
intended markup from template() and the div remain.

---

Nitpick comments:
In `@frontend/viewer/src/project/browse/sort/SortMenu.svelte`:
- Line 51: The trigger currently composes both buttonVariants and badgeVariants
(ResponsiveMenu.Trigger with cn(buttonVariants(...), badgeVariants(...))),
causing conflicting sizing/spacing; remove badgeVariants usage and rely on
buttonVariants({ variant: 'secondary', size: 'xs' }) as the single source of
truth, then add any explicit badge-like overrides (e.g., small padding,
rounded-full, text-xs) directly in the class string or via a small helper so
ResponsiveMenu.Trigger styling is deterministic and does not depend on class
order.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 5bbbb19b-46ed-48ed-8fc6-bf8da048c897

📥 Commits

Reviewing files that changed from the base of the PR and between f896e70 and bb2c733.

📒 Files selected for processing (18)
  • frontend/viewer/src/app.css
  • frontend/viewer/src/home/AppBar.svelte
  • frontend/viewer/src/home/HomeView.svelte
  • frontend/viewer/src/home/ProjectListItem.svelte
  • frontend/viewer/src/lib/components/ListItem.svelte
  • frontend/viewer/src/lib/components/ThemePicker.svelte
  • frontend/viewer/src/lib/components/ui/button/button.svelte
  • frontend/viewer/src/lib/components/ui/input/composable-input.svelte
  • frontend/viewer/src/lib/components/ui/input/input-shell.svelte
  • frontend/viewer/src/lib/components/ui/input/input.svelte
  • frontend/viewer/src/project/ProjectSidebar.svelte
  • frontend/viewer/src/project/browse/EntryView.svelte
  • frontend/viewer/src/project/browse/sort/SortMenu.svelte
  • frontend/viewer/src/project/data/writing-system-service.svelte.ts
  • frontend/viewer/src/project/demo/demo-entry-data.ts
  • frontend/viewer/src/stories/editor/fields/ws-colors.stories.svelte
  • frontend/viewer/src/theme.css
  • frontend/viewer/tailwind.config.ts
💤 Files with no reviewable changes (1)
  • frontend/viewer/tailwind.config.ts

Comment thread frontend/viewer/src/lib/components/ListItem.svelte
Comment thread frontend/viewer/src/stories/editor/fields/ws-colors.stories.svelte
@myieye myieye merged commit 3f62d45 into develop Mar 10, 2026
33 of 35 checks passed
@myieye myieye deleted the update-shadcn-theme branch March 10, 2026 13:06
myieye added a commit that referenced this pull request Mar 13, 2026
* Update to latest shadcn themes

* Fix broken theme values
The contrast of the current values is unacceptable and the themes demo page is using these new values

* Improve theme-picker trigger contrast on home page

* Adapt ListItem to new theme colors

* Fix: dark outline button border color

* Adapt ghost and shell inputs to new shadcn theme

* Use button styling for sort badge-button

* Redesign ListItem states
Now it uses "focus-visible:ring-[3px] focus-visible:ring-ring/50" like everything else

* Fix broken outlines in dark mode
This was only affecting ListItem, which isn't using an outline anymore. So, the issue doesn't currently affect us, but it was VERY confusing.

* Improve writing system contrast

* Fix Add sense button outline cropped

* Improve primary color contrast

* Add story for demoing theme colors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant